<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="API docs for the ParticleSystem constructor from the Class ParticleSystem class from the spritewidget library, for the Dart programming language.">
  <title>ParticleSystem constructor - ParticleSystem class - spritewidget library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="../..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">spritewidget</a></li>
    <li><a href="spritewidget/spritewidget-library.html">spritewidget</a></li>
    <li><a href="spritewidget/ParticleSystem-class.html">ParticleSystem</a></li>
    <li class="self-crumb">ParticleSystem constructor</li>
  </ol>
  <div class="self-name">ParticleSystem</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <h5>ParticleSystem class</h5>
    <ol>
      <li class="section-title"><a href="spritewidget/ParticleSystem-class.html#constructors">Constructors</a></li>
      <li><a href="spritewidget/ParticleSystem/ParticleSystem.html">ParticleSystem</a></li>
    
      <li class="section-title">
        <a href="spritewidget/ParticleSystem-class.html#instance-properties">Properties</a>
      </li>
      <li><a href="spritewidget/ParticleSystem/alphaVar.html">alphaVar</a></li>
      <li><a href="spritewidget/ParticleSystem/autoRemoveOnFinish.html">autoRemoveOnFinish</a></li>
      <li><a href="spritewidget/ParticleSystem/blueVar.html">blueVar</a></li>
      <li><a href="spritewidget/ParticleSystem/colorSequence.html">colorSequence</a></li>
      <li><a href="spritewidget/ParticleSystem/direction.html">direction</a></li>
      <li><a href="spritewidget/ParticleSystem/directionVar.html">directionVar</a></li>
      <li><a href="spritewidget/ParticleSystem/emissionRate.html">emissionRate</a></li>
      <li><a href="spritewidget/ParticleSystem/endRotation.html">endRotation</a></li>
      <li><a href="spritewidget/ParticleSystem/endRotationVar.html">endRotationVar</a></li>
      <li><a href="spritewidget/ParticleSystem/endSize.html">endSize</a></li>
      <li><a href="spritewidget/ParticleSystem/endSizeVar.html">endSizeVar</a></li>
      <li><a href="spritewidget/ParticleSystem/gravity.html">gravity</a></li>
      <li><a href="spritewidget/ParticleSystem/greenVar.html">greenVar</a></li>
      <li><a href="spritewidget/ParticleSystem/insertionOffset.html">insertionOffset</a></li>
      <li><a href="spritewidget/ParticleSystem/life.html">life</a></li>
      <li><a href="spritewidget/ParticleSystem/lifeVar.html">lifeVar</a></li>
      <li><a href="spritewidget/ParticleSystem/maxParticles.html">maxParticles</a></li>
      <li><a href="spritewidget/ParticleSystem/numParticlesToEmit.html">numParticlesToEmit</a></li>
      <li><a href="spritewidget/ParticleSystem/opacity.html">opacity</a></li>
      <li><a href="spritewidget/ParticleSystem/posVar.html">posVar</a></li>
      <li><a href="spritewidget/ParticleSystem/radialAcceleration.html">radialAcceleration</a></li>
      <li><a href="spritewidget/ParticleSystem/radialAccelerationVar.html">radialAccelerationVar</a></li>
      <li><a href="spritewidget/ParticleSystem/redVar.html">redVar</a></li>
      <li><a href="spritewidget/ParticleSystem/rotateToMovement.html">rotateToMovement</a></li>
      <li><a href="spritewidget/ParticleSystem/speed.html">speed</a></li>
      <li><a href="spritewidget/ParticleSystem/speedVar.html">speedVar</a></li>
      <li><a href="spritewidget/ParticleSystem/startRotation.html">startRotation</a></li>
      <li><a href="spritewidget/ParticleSystem/startRotationVar.html">startRotationVar</a></li>
      <li><a href="spritewidget/ParticleSystem/startSize.html">startSize</a></li>
      <li><a href="spritewidget/ParticleSystem/startSizeVar.html">startSizeVar</a></li>
      <li><a href="spritewidget/ParticleSystem/tangentialAcceleration.html">tangentialAcceleration</a></li>
      <li><a href="spritewidget/ParticleSystem/tangentialAccelerationVar.html">tangentialAccelerationVar</a></li>
      <li><a href="spritewidget/ParticleSystem/texture.html">texture</a></li>
      <li><a href="spritewidget/ParticleSystem/transferMode.html">transferMode</a></li>
      <li class="inherited"><a href="spritewidget/Node/actions.html">actions</a></li>
      <li class="inherited"><a href="spritewidget/Node/children.html">children</a></li>
      <li class="inherited"><a href="spritewidget/Node/constraints.html">constraints</a></li>
      <li class="inherited"><a href="spritewidget/Node/handleMultiplePointers.html">handleMultiplePointers</a></li>
      <li class="inherited"><a href="dart-core/Object/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="spritewidget/Node/inverseTransformMatrix.html">inverseTransformMatrix</a></li>
      <li class="inherited"><a href="spritewidget/Node/parent.html">parent</a></li>
      <li class="inherited"><a href="spritewidget/Node/paused.html">paused</a></li>
      <li class="inherited"><a href="spritewidget/Node/position.html">position</a></li>
      <li class="inherited"><a href="spritewidget/Node/rotation.html">rotation</a></li>
      <li class="inherited"><a href="dart-core/Object/runtimeType.html">runtimeType</a></li>
      <li class="inherited"><a href="spritewidget/Node/scale.html">scale</a></li>
      <li class="inherited"><a href="spritewidget/Node/scaleX.html">scaleX</a></li>
      <li class="inherited"><a href="spritewidget/Node/scaleY.html">scaleY</a></li>
      <li class="inherited"><a href="spritewidget/Node/skewX.html">skewX</a></li>
      <li class="inherited"><a href="spritewidget/Node/skewY.html">skewY</a></li>
      <li class="inherited"><a href="spritewidget/Node/spriteBox.html">spriteBox</a></li>
      <li class="inherited"><a href="spritewidget/Node/transformMatrix.html">transformMatrix</a></li>
      <li class="inherited"><a href="spritewidget/Node/userInteractionEnabled.html">userInteractionEnabled</a></li>
      <li class="inherited"><a href="spritewidget/Node/visible.html">visible</a></li>
      <li class="inherited"><a href="spritewidget/Node/zPosition.html">zPosition</a></li>
    
      <li class="section-title"><a href="spritewidget/ParticleSystem-class.html#instance-methods">Methods</a></li>
      <li><a href="spritewidget/ParticleSystem/paint.html">paint</a></li>
      <li><a href="spritewidget/ParticleSystem/reset.html">reset</a></li>
      <li><a href="spritewidget/ParticleSystem/update.html">update</a></li>
      <li class="inherited"><a href="spritewidget/Node/addChild.html">addChild</a></li>
      <li class="inherited"><a href="spritewidget/Node/applyConstraints.html">applyConstraints</a></li>
      <li class="inherited"><a href="spritewidget/Node/computeTransformMatrix.html">computeTransformMatrix</a></li>
      <li class="inherited"><a href="spritewidget/Node/convertPointFromNode.html">convertPointFromNode</a></li>
      <li class="inherited"><a href="spritewidget/Node/convertPointToBoxSpace.html">convertPointToBoxSpace</a></li>
      <li class="inherited"><a href="spritewidget/Node/convertPointToNodeSpace.html">convertPointToNodeSpace</a></li>
      <li class="inherited"><a href="spritewidget/Node/handleEvent.html">handleEvent</a></li>
      <li class="inherited"><a href="spritewidget/Node/invalidateTransformMatrix.html">invalidateTransformMatrix</a></li>
      <li class="inherited"><a href="spritewidget/Node/isPointInside.html">isPointInside</a></li>
      <li class="inherited"><a href="dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="spritewidget/Node/removeAllChildren.html">removeAllChildren</a></li>
      <li class="inherited"><a href="spritewidget/Node/removeChild.html">removeChild</a></li>
      <li class="inherited"><a href="spritewidget/Node/removeFromParent.html">removeFromParent</a></li>
      <li class="inherited"><a href="spritewidget/Node/spriteBoxPerformedLayout.html">spriteBoxPerformedLayout</a></li>
      <li class="inherited"><a href="dart-core/Object/toString.html">toString</a></li>
    
      <li class="section-title inherited"><a href="spritewidget/ParticleSystem-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="dart-core/Object/operator_equals.html">operator ==</a></li>
    
    
    
    </ol>
  </div><!--/.sidebar-offcanvas-left-->

  <div class="col-xs-12 col-sm-9 col-md-8 main-content">
    <h1>ParticleSystem constructor</h1>

    <section class="multi-line-signature">
      
      <span class="name ">ParticleSystem</span>(<wbr><span class="parameter" id="-param-texture"><span class="type-annotation"><a href="spritewidget/SpriteTexture-class.html">SpriteTexture</a></span> <span class="parameter-name">texture</span>, {</span> <span class="parameter" id="-param-life"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">life</span>: <span class="default-value">1.5</span>, </span> <span class="parameter" id="-param-lifeVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">lifeVar</span>: <span class="default-value">1.0</span>, </span> <span class="parameter" id="-param-posVar"><span class="type-annotation"><a href="dart-ui/Offset-class.html">Offset</a></span> <span class="parameter-name">posVar</span>: <span class="default-value">Offset.zero</span>, </span> <span class="parameter" id="-param-startSize"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">startSize</span>: <span class="default-value">2.5</span>, </span> <span class="parameter" id="-param-startSizeVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">startSizeVar</span>: <span class="default-value">0.5</span>, </span> <span class="parameter" id="-param-endSize"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">endSize</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-endSizeVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">endSizeVar</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-startRotation"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">startRotation</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-startRotationVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">startRotationVar</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-endRotation"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">endRotation</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-endRotationVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">endRotationVar</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-rotateToMovement"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">rotateToMovement</span>: <span class="default-value">false</span>, </span> <span class="parameter" id="-param-direction"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">direction</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-directionVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">directionVar</span>: <span class="default-value">360.0</span>, </span> <span class="parameter" id="-param-speed"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">speed</span>: <span class="default-value">100.0</span>, </span> <span class="parameter" id="-param-speedVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">speedVar</span>: <span class="default-value">50.0</span>, </span> <span class="parameter" id="-param-radialAcceleration"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">radialAcceleration</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-radialAccelerationVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">radialAccelerationVar</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-tangentialAcceleration"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">tangentialAcceleration</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-tangentialAccelerationVar"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">tangentialAccelerationVar</span>: <span class="default-value">0.0</span>, </span> <span class="parameter" id="-param-maxParticles"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">maxParticles</span>: <span class="default-value">100</span>, </span> <span class="parameter" id="-param-emissionRate"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">emissionRate</span>: <span class="default-value">50.0</span>, </span> <span class="parameter" id="-param-colorSequence"><span class="type-annotation"><a href="spritewidget/ColorSequence-class.html">ColorSequence</a></span> <span class="parameter-name">colorSequence</span>, </span> <span class="parameter" id="-param-alphaVar"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">alphaVar</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="-param-redVar"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">redVar</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="-param-greenVar"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">greenVar</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="-param-blueVar"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">blueVar</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="-param-transferMode"><span class="type-annotation"><a href="dart-ui/BlendMode-class.html">BlendMode</a></span> <span class="parameter-name">transferMode</span>: <span class="default-value">BlendMode.plus</span>, </span> <span class="parameter" id="-param-numParticlesToEmit"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">numParticlesToEmit</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="-param-autoRemoveOnFinish"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">autoRemoveOnFinish</span>: <span class="default-value">true</span>, </span> <span class="parameter" id="-param-gravity"><span class="type-annotation"><a href="dart-ui/Offset-class.html">Offset</a></span> <span class="parameter-name">gravity</span>, </span> <span class="parameter" id="-param-data"><span class="type-annotation"><a href="dart-core/String-class.html">String</a></span> <span class="parameter-name">data</span></span> })
    </section>

    <section class="desc markdown">
      <p>Creates a new particle system with the given properties. The only
required parameter is the texture, all other parameters are optional.</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span> </h2>
      <pre class="language-dart"><code class="language-dart">ParticleSystem(this.texture,
               {this.life: 1.5,
                this.lifeVar: 1.0,
                this.posVar: Offset.zero,
                this.startSize: 2.5,
                this.startSizeVar: 0.5,
                this.endSize: 0.0,
                this.endSizeVar: 0.0,
                this.startRotation: 0.0,
                this.startRotationVar: 0.0,
                this.endRotation: 0.0,
                this.endRotationVar: 0.0,
                this.rotateToMovement : false,
                this.direction: 0.0,
                this.directionVar: 360.0,
                this.speed: 100.0,
                this.speedVar: 50.0,
                this.radialAcceleration: 0.0,
                this.radialAccelerationVar: 0.0,
                this.tangentialAcceleration: 0.0,
                this.tangentialAccelerationVar: 0.0,
                this.maxParticles: 100,
                this.emissionRate: 50.0,
                this.colorSequence,
                this.alphaVar: 0,
                this.redVar: 0,
                this.greenVar: 0,
                this.blueVar: 0,
                this.transferMode: BlendMode.plus,
                this.numParticlesToEmit: 0,
                this.autoRemoveOnFinish: true,
                Offset gravity,
                String data,
}) {
  this.gravity = gravity;
  _particles = new List&lt;_Particle&gt;();
  _emitCounter = 0.0;
  &#47;&#47; _elapsedTime = 0.0;
  if (_gravity == null)
    _gravity = new Vector2.zero();
  if (colorSequence == null)
    colorSequence = new ColorSequence.fromStartAndEndColor(new Color(0xffffffff), new Color(0x00ffffff));

  insertionOffset = Offset.zero;

  if (data != null) {
    deserializeParticleSystem(json.decode(data), particleSystem: this);
  }
}</code></pre>
    </section>

  </div> <!-- /.main-content -->

  <div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    spritewidget 0.9.16
  </span>

</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
